<template>
  <div class="app-main-container">
    <div class="app-main-title">
      查看任务
      <div class="goback" @click="goBack">
        <i class="el-icon-refresh-left" /> 返回上一页
      </div>
    </div>

    <el-form
      class="doumee-form"
      label-width="130px"
      label-suffix="："
    >
      <div class="property-title">任务信息</div>
      <el-form-item label="任务名称">
        <span>{{ info.name }}</span>
      </el-form-item>
      <el-form-item label="任务描述">
        <span>{{ info.taskInfo }}</span>
      </el-form-item>
      <el-form-item label="关联消费类型">
        <span>{{ info.typeInfo }}</span>
      </el-form-item>
      <el-form-item label="佣金比例(%)">
        <span>{{ info.ratio }}</span>
      </el-form-item>
      <el-form-item label="单笔起底金额">
        <span>{{ info.beginMoney }}</span>
      </el-form-item>
      <el-form-item label="返佣笔数">
        <span>{{ info.orderNum }}</span>
      </el-form-item>
      <el-form-item label="任务有效期">
        <span>{{ info.beginTime || '' }}</span>
        <span v-if="info.beginTime && info.endTime">~</span>
        <span v-else>不限</span>
        <span>{{ info.endTime || '' }}</span>
      </el-form-item>
      <el-form-item label="创建时间">
        <span>{{ info.createTime }}</span>
      </el-form-item>
      <div class="property-title">分享海报</div>

      <!-- <el-form-item label="分享封面">
        <el-image
          style="width: 200px"
          :preview-src-list="[info.shareFmPath]"
          :src="info.shareFmPath"
        />
      </el-form-item> -->
      <el-form-item label="海报/分享封面">
        <el-image
          style="width: 200px"
          :preview-src-list="[info.sharePicPath]"
          :src="info.sharePicPath"
        />
      </el-form-item>
      <el-form-item label="二维码位置">
        <span v-if="info.postion === '0'">居中</span>
        <span v-if="info.postion === '1'">左下</span>
        <span v-if="info.postion === '2'">右下</span>
      </el-form-item>
      <el-form-item label="二维码跳转">
        <span>{{ info.shareUrlTitle }}</span>
      </el-form-item>
      <el-form-item label="分享/海报标题">
        <span>{{ info.shareTitle }}</span>
      </el-form-item>
      <!-- <el-form-item label="分享/海报描述">
        <span>{{ info.shareInfo }}</span>
      </el-form-item> -->
    </el-form>
  </div>
</template>

<script>
import { ShareDetail } from '@/api'
export default {
  data() {
    return {
      id: '',
      info: {}
    }
  },
  created() {
    this.id = this.$route.query.id
    this.getInfo()
  },
  methods: {
    getInfo() {
      ShareDetail({ param: { shareId: this.id }}).then(res => {
        this.info = res.record
      })
    },
    goBack() {
      this.$router.replace('/application/shareModule?activeTab=1')
    }
  }
}
</script>

<style>

</style>
